<div class="container">
  <div class="row">
    <div class="col-md-12 col-lg-9">
      <%= form_for @changeset, Routes.asciicast_path(@conn, :update, @changeset.data), fn f -> %>
        <legend>Asciicast settings</legend>

        <div class="form-group row">
          <%= label f, :title, class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= text_input f, :title, class: "form-control", autofocus: true %>
            <%= error_tag f, :title %>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :description, class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= textarea f, :description, class: "form-control", rows: 10 %>
            <%= error_tag f, :description %>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :cols_override, "Terminal columns", class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= text_input f, :cols_override, class: "form-control", type: "number", min: 1, step: 1, placeholder: @asciicast.cols %>
            <%= error_tag f, :cols_override %>
            <small class="form-text text-muted">Leave blank to use recording's original value.</small>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :rows_override, "Terminal rows", class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= text_input f, :rows_override, class: "form-control", type: "number", min: 1, step: 1, placeholder: @asciicast.rows %>
            <%= error_tag f, :rows_override %>
            <small class="form-text text-muted">Leave blank to use recording's original value.</small>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :theme_name, "Terminal theme", class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= select f, :theme_name, theme_options(), class: "form-control", prompt: "Default (#{default_theme_name(@changeset.data)})" %>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :snapshot_at, "Thumbnail frame", class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= text_input f, :snapshot_at, class: "form-control", type: "number", min: 0, step: "0.1" %>
            <%= error_tag f, :snapshot_at %>
            <small class="form-text text-muted">Time of the frame to be displayed as snapshot/poster (float, in seconds, for example: 10.5)</small>
          </div>
        </div>

        <div class="form-group row">
          <%= label f, :idle_time_limit, "Idle time limit", class: "col-sm-4 col-md-3 col-lg-3 col-form-label" %>
          <div class="col-sm-8 col-md-9 col-lg-9">
            <%= text_input f, :idle_time_limit, class: "form-control", type: "number", min: 0.5, step: "0.5" %>
            <%= error_tag f, :idle_time_limit %>
            <small class="form-text text-muted">Limit terminal inactivity to a given number of seconds. Leave blank for no limit.</small>
          </div>
        </div>

        <div class="form-group row">
          <div class="offset-sm-4 col-sm-8 offset-md-3 col-md-9 offset-lg-3 col-lg-9">
            <%= submit "Save", class: "btn btn-primary" %>
            <%= link "Cancel", to: Routes.asciicast_path(@conn, :show, @changeset.data), class: "btn" %>
          </div>
        </div>
      <% end %>
    </div>
  </div>
</div>
